function getRemainningTime(endTime) {
    
    const now = new Date()
    const end = new Date(endTime)
    console.log("now Date 对象:", now)
    console.log("end Date 对象:", end)
    const diffMs = end - now

    if(diffMs <= 0) {
        return "活动已经结束"
    }

    // 计算剩余天数（1天 = 24*60*60*1000 毫秒）
    const days = Math.floor(diffMs / (1000 * 60 * 60 * 24));
    // 剩余毫秒数减去天数部分，计算剩余小时
    const remainingMsAfterDays = diffMs % (1000 * 60 * 60 * 24);
    const hours = Math.floor(remainingMsAfterDays / (1000 * 60 * 60));
    // 剩余毫秒数减去小时部分，计算剩余分钟
    const remainingMsAfterHours = remainingMsAfterDays % (1000 * 60 * 60);
    const minutes = Math.floor(remainingMsAfterHours / (1000 * 60));

    let result = "剩余"
    if(days > 0) {
        result += `${days}天`
    }
    if(hours > 0) {
        result += `${hours}小时`
    }
    result += `${minutes}分钟`

    return result
}

console.log(getRemainningTime("2025-11-12 00:00:00"))